package com.star.controller;

import com.star.service.BlogService;
import com.star.service.impl.BlogServiceImpl;
import com.star.vo.BlogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * com.star.controller
 *
 * @Description: 时间轴控制器
 * @Date: 2020-08-11 16:38
 * @Author: LENSTAR
 * @URL: http://123.57.161.114:9000/
 */
@Controller
public class ArchiveShowController {

    @Autowired
    private BlogServiceImpl blogService;

    @GetMapping("/archives")
    public String archive(Model model) {
        List<BlogVo> allBlog = blogService.getAllBlog();
        model.addAttribute("blogs", allBlog);
        return "archives";
    }
}
